feat: add AgentCoreSessionService for AgentCore Memory - #6944
Open
a2105z wants to merge 1 commit into
Open
Conversation
Store ADK sessions in AgentCore short-term memory using the conversational+blob mapping from the google#6920 PoC, and implement the rest of BaseSessionService (ids, get/list/delete, partial skip). Fixes google#6920
Contributor
Author
|
Hi @wukath, @sanketpatil06, @GWeale — could I please ask for a review when you have a chance? This is the Happy to change anything that does not match how you want integrations to land. Thank you very much. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AgentCoreSessionService, aBaseSessionServicebacked by Amazon Bedrock AgentCore Memory short-term memory, soRunner(session_service=...)can persist ADK sessions there.conversationalpayload (when there is text) plus ablobof the full ADKEventJSON, so STM extraction still works and tool calls / state / metadata round-trip.BaseSessionServicecontract on top of that mapping: generated session ids,AlreadyExistsError,get_sessionreturningNonewhen missing,list_sessions(including all users of an app),delete_sessionviadelete_event, skippartialevents, bootstrap event so empty sessions exist in AgentCore, andactorId = {app_name}:{user_id}so two ADK apps sharing a Memory resource do not collide.Fixes #6920
Test plan
uv run pytest tests/unittests/integrations/agentcore/test_agentcore_session_service.py— 12 passed (fakebedrock-agentcoreclient)GetSessionConfigfilters, state_delta replay (temp:dropped)agent.py)